﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Interop.Excel;

namespace QExcel
{
    public class QRange : QItem
    {
        public int StartRow
        {
            get;
            set;
        }

        public int StartColumn
        {
            get;
            set;
        }
        public int RowCount
        {
            get;
            set;
        }
        public int ColumnCount
        {
            get;
            set;
        }

        public object Content
        {
            get;
            set;
        }

        public override void Output()
        {
            Worksheet workSheet = this.Sheet.WorkSeet;
            Range range = workSheet.get_Range(workSheet.Cells[StartRow,StartColumn ], workSheet.Cells[StartRow + RowCount - 1, StartColumn + ColumnCount - 1]);
            range.Merge(Type.Missing);
            range.RowHeight = this.Height;
            this.SetStyle(range);
            range.Value2 = Content;
        }
    }
}
